import random
import math

# 基本随机数
print("0-1随机浮点数:", random.random())

print("1-10随机整数:", random.randint(1, 10))
print("1-10随机浮点数:", math.floor(random.random() * 10))
print("1-100随机偶数:", random.randrange(0, 101, 2))
print("5.0-10.0随机浮点数:", random.uniform(5.0, 10.0))


items = ["apple", "banana", "cherry", "date"]

# 随机选择
print("随机选择:", random.choice(items))
print("随机选择多个:", random.choices(items, k=3))
print("随机抽样:", random.sample(items, 2))


def generate_check_code():
    char_str = "01A23B45C6D7a8E9ab012cd345ef57ghij78k6l67mnop57qrsHtuGvwFxyzI098JakkdK9D0OMa1N1289082uVUkasd2319VWXYZ"
    # 从字符串中随机选择6个字符
    random_str = random.choices(char_str, k=6)
    return random_str


for i in range(10):
    code = generate_check_code()
    print("code=", "".join(code))
